<?php

class Listuser extends Controller {

    public $error;
    public $users;
    public $userLog;

    public function __construct() {
        parent::__construct();
        $this->_initialize();
    }

    public function __destruct() {
        parent::__destruct();
    }

    public function index() {
        if (!isset($this->_session['user'])) {
            header('Location:index.php');
        }
        $this->template('users');
    }

    public function _initialize() {
        $this->model('user');
        if (isset($this->_session['user'])) {
            $this->userLog = $this->_session['user']['info'];
        } else {
            header('Location:index.php?c=login');
        }
        $this->user->id = $this->userLog->id;
        $this->users = $this->user->gets();
    }

}

?>
